from bs4 import BeautifulSoup

soup = BeautifulSoup(open("web.html"), "html.parser")
soup = BeautifulSoup("<html><p>contentone</p><b>contenttwo</b></html>", "html.parser")